applying reimann sum for the midpoint rule and 3 partitions